package com.hou.rocketmq.consumer;

import com.hou.rocketmq.pojo.User;
import org.apache.rocketmq.spring.annotation.RocketMQMessageListener;
import org.apache.rocketmq.spring.core.RocketMQListener;
import org.springframework.stereotype.Component;

@Component
@RocketMQMessageListener(topic = "test-topic-01", consumerGroup = "my-consumer_test-topic-01")
public class UserConsumer implements RocketMQListener<User> {
    @Override
    public void onMessage(User message) {
        System.out.println("接受到消息:"+message.toString());
    }
}
